#!/bin/bash
if [[ ! -h ./sysmodel ]]
then echo "Creating symlink..." && ln -s /usr/local/include/sysmodel ./sysmodel
fi
echo "Updating sysmodel (root password required)..."
cd sandbox$1
java -jar /usr/local/jar/lc.jar --sys proc$1sys.xml
cd ..
su -c "cp sandbox$1/* sysmodel"
echo "Generating new main file..."
java -jar /usr/local/jar/lc.jar --main $2.xml sysmodel/proc$1sys.xml
echo "Generating profile files..."
java -jar /usr/local/jar/lc.jar --prof $2.xml sysmodel/proc$1sys.xml
#echo "Updating resource usage..."
#cp lc_app1_Application.h.$1 lc_app1_Application.h
#echo "Compiling..."
#make > /dev/null

